package com.demo.testpackage;

import org.apache.commons.lang3.StringUtils;

import java.util.*;

public class T4 {
    public static void main(String[] args) {

        List<String> strList = new ArrayList<>();
        strList.add("AAA BBB");
        strList.add("mm qq");

        strList.stream().forEach(s -> System.out.println(s));
        System.out.println("==========");
        // 对于"AAA BBB"类型的字符串进行拆分处理
        // 对strList集合处理
        for (int i = 0; i < strList.size()-1; i++) {
            for (int j = 1; j <strList.size() ; j++) {
                if (strList.get(i).contains(" ")) {
                    String[] s = strList.get(i).split(" ");
                    for (String s1:s) {
                        if (strList.get(j).contains(" ")) {
                            String[] s2 = strList.get(j).split(" ");
                            for (String s3:s2) {
                                if ("".equals(s3)) {
                                    continue;
                                }
                                System.out.println(s1+"|"+s3);
                            }
                        }
                    }
                }
            }
        }
    }
}
